package com.wenjoying.user.message;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.messaging.support.MessageBuilder;

@EnableBinding(MySource.class)
public class Producer {

    @Autowired
    private MySource source;

    public void publish(String msg) {
        boolean flag = source.output().send(MessageBuilder.withPayload(msg).build());
        System.out.println(flag);
    }

}
